#include "precompiled.h"
#include "svlTest_TEvents.h"
using namespace svlTest_TEvents;

///////////////////////////////////////////////////////////////////////////////

//
void svlTest_TEvents::Test()
{
  struct TEventsX : public TComponent::TEvents
  {
    virtual void TEvents_Ev0(TParam &Param)
    {
      TEvents::TEvents_Ev0(Param);
    }
  }
  EventsX;

  struct TEventsA : public TComponent::TEvents
  {
    virtual void TEvents_Ev0(TParam &Param)
    {
      TEvents::TEvents_Ev0(Param);
    }
    virtual void TEvents_Ev1(TI &I,TComponent &Sender)
    {
      TComponent::TEvents::TEvents_Ev1(I,Sender);
    }
    virtual void TEvents_Ev2(TI &I,TComponent &Sender)
    {
      TComponent::TEvents::TEvents_Ev2(I,Sender);
    }
  }
  EventsA;

  struct TEventsB : public TComponent::TEvents
  {
    virtual void TEvents_Ev0(TParam &Param)
    {
      TEvents::TEvents_Ev0(Param);
    }
    virtual void TEvents_Ev1(TI &I,TComponent &Sender)
    {
      TComponent::TEvents::TEvents_Ev1(I,Sender);
    }
  }
  EventsB;

  struct TEventsC : public TComponent::TEvents
  {
    virtual void TEvents_Ev1(TI &I,TComponent &Sender)
    {
      TComponent::TEvents::TEvents_Ev1(I,Sender);
    }
  }
  EventsC;


  TComponent C1,C2;

  C1.Events.Link(EventsX);
  C1.Events.Link(EventsA);
  C1.Events.Link(EventsB);
  C1.Events.Link(EventsC);
  C1.Events.Link(EventsA);
  C1.Ev0();


//  C1.Ev1();

  C2.Events.Link(EventsB);
//  C2.Ev1();

  C1.Events.Unlink(EventsB);
// C1.Ev1();

  //  EventsC.Unlink();
//  C1.Ev1();

  //svl::TWindow Win; 
  //Win.MoveWindow(50,50,100,700); 
  //Win.Show(); 
}
